#ifndef VDTALKWGT_H
#define VDTALKWGT_H

#include <QWidget>
namespace Ui {class VDTalkWgt;};

class VDMesWebView;
class VDUser;
class VDSmiles;
class VDSmile;

class VDTalkWgt : public QWidget
{
	Q_OBJECT

public:
	VDTalkWgt(const VDSmiles &smiles, const VDUser *u, QWidget *parent = 0);
	~VDTalkWgt();

	void addMesUser(const QString &mes, const VDUser &u);
	void addChatUser(const QString &mes, const VDUser &u);
	void addMesMaster(const QString &mes);
	void addChatMaster(const QString &mes);

// 	void addMesUser(const QString &mes, const VDUser &u);
// 	void addMesUser(const QString &mes);

	const VDUser* getUser() { return m_user; }
	bool isOnlyChat() { return (m_user == NULL);}

	void setDontRead(bool dontRead);
	bool isDontRead();

protected:
	virtual void timerEvent(QTimerEvent *event);

private:
	Ui::VDTalkWgt *ui;
	VDMesWebView *m_mesWebView;

	const VDSmiles &m_smiles;
	const VDUser *m_user;

	int m_countDontRead;
	int m_timerId;
	bool m_isIconState;


private slots:
	void slotQuote_clicked();

	void slotClickedSmile(const VDSmile&);

	void slotTextChanged();
	void slotSend_clicked();
	void slotChat_clicked();

signals:
	void sendMesUser(const QString&, const VDUser&);
	void sendMesChat(const QString&);
	void changeIcon(const QIcon&);
};

#endif // VDTALKWGT_H
